From 2dafd6815eaad8a03ad74a3b96eb9e71ed4511ba Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 1 Nov 2010 03:30:42 +0000 Subject: [PATCH] Modify internal data structures when input or output filenames are manually edited. --- gpsbabel/gui/app.pro | 3 ++- gpsbabel/gui/mainwindow.cpp | 17 ++++++++++++++++- gpsbabel/gui/mainwindow.h | 4 +++- gpsbabel/gui/preferences.cpp | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gpsbabel/gui/app.pro b/gpsbabel/gui/app.pro index 57a781e6e..6d2324da2 100755 --- a/gpsbabel/gui/app.pro +++ b/gpsbabel/gui/app.pro @@ -1,10 +1,11 @@ -# $Id: app.pro,v 1.18 2010-06-19 23:59:06 robertl Exp $ +# $Id: app.pro,v 1.19 2010-11-01 03:30:42 robertl Exp $ # CONFIG += qt release #CONFIG += qt debug console # For Mac, build Universal binary. Ignored on other OSes. +# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk CONFIG += x86 ppc ICON = images/appicon.icns diff --git a/gpsbabel/gui/mainwindow.cpp b/gpsbabel/gui/mainwindow.cpp index d28d87952..d8f172dec 100644 --- a/gpsbabel/gui/mainwindow.cpp +++ b/gpsbabel/gui/mainwindow.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.cpp,v 1.26 2010-10-31 19:31:26 robertl Exp $ +// $Id: mainwindow.cpp,v 1.27 2010-11-01 03:30:42 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -177,6 +177,10 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent) connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(closeActionX())); connect(ui.xlateFiltersBtn, SIGNAL(clicked()), this, SLOT(filtersClicked())); + connect(ui.inputFileNameText, SIGNAL(textEdited(QString)), this, SLOT(inputFileNameEdited())); + connect(ui.outputFileNameText, SIGNAL(textEdited(QString)), this, SLOT(outputFileNameEdited())); + + ui.buttonBox->button(QDialogButtonBox::Apply)->setIcon(QIcon(":images/runit.png")); ui.buttonBox->button(QDialogButtonBox::Close)->setIcon(QIcon(":images/exit.png")); @@ -362,6 +366,17 @@ void MainWindow:: outputDeviceOptBtnClicked() } fmtChgInterlock = false; } +void MainWindow::inputFileNameEdited() +{ + bd.inputFileNames.clear(); + bd.inputFileNames << ui.inputFileNameText->text(); +} + +void MainWindow::outputFileNameEdited() +{ + bd.outputFileName = ui.outputFileNameText->text(); + +} //------------------------------------------------------------------------ QString MainWindow::filterForFormat(int idx) diff --git a/gpsbabel/gui/mainwindow.h b/gpsbabel/gui/mainwindow.h index 07a7d7ebe..9c449cfe9 100644 --- a/gpsbabel/gui/mainwindow.h +++ b/gpsbabel/gui/mainwindow.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.h,v 1.12 2010-06-27 21:12:37 robertl Exp $ +// $Id: mainwindow.h,v 1.13 2010-11-01 03:30:42 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -105,9 +105,11 @@ protected: void inputFileOptBtnClicked(); void inputFormatChanged(int); void inputOptionButtonClicked(); + void inputFileNameEdited(); void moreOptionButtonClicked(); void outputDeviceOptBtnClicked(); void outputFileOptBtnClicked(); + void outputFileNameEdited(); void outputFormatChanged(int); void outputOptionButtonClicked(); void preferencesActionX(); diff --git a/gpsbabel/gui/preferences.cpp b/gpsbabel/gui/preferences.cpp index 66293661f..11fccf95b 100644 --- a/gpsbabel/gui/preferences.cpp +++ b/gpsbabel/gui/preferences.cpp @@ -43,7 +43,7 @@ Preferences::Preferences(QWidget* parent, QList& formatList, ui_.reportStatisticsCheck->setChecked(bd_.reportStatistics); ui_.ignoreVersionMismatchCheck->setChecked(bd_.ignoreVersionMismatch); // Because of an unfortunate bug in 1.4.0, we turn this off in 1.4.1. - if (VERSION == "1.4.1") + if (VERSION == QString("1.4.1")) bd_.ignoreVersionMismatch = false; connect (ui_.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked())); -- 2.30.2